import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		config: {}, // 店铺配置信息
		orderTab: 0, // 选中的订单tab页
		redirectPage: '',
		uuid:'',//当前客户端
		searchStyle: '',
		searchFixed:false,//搜索框样式
		userShip: {}, //地区信息
		invoice: {}, //发票信息
		shopAddress: {}, // 选择门店地址
		tabbarList: [{
				iconPath: "https://labulado.oss-cn-guangzhou.aliyuncs.com/t1.png",
				selectedIconPath: "https://labulado.oss-cn-guangzhou.aliyuncs.com/t2.png",
				text: '首页',
				pagePath:'/pages/index/index'
			},
			{
				iconPath: "https://labulado.oss-cn-guangzhou.aliyuncs.com/t3.png",
				selectedIconPath: "https://labulado.oss-cn-guangzhou.aliyuncs.com/t4.png",
				text: '社区',
				pagePath:'/pages/community/index'
			},
			{
				iconPath: "",
				selectedIconPath: "",
				text: '产品DIY',
				midButton: true,
				pagePath:'/pages/product/index'
			},
			{
				iconPath: "https://labulado.oss-cn-guangzhou.aliyuncs.com/t5.png",
				selectedIconPath: "https://labulado.oss-cn-guangzhou.aliyuncs.com/t6.png",
				text: '购物车',
				customIcon: false,
				pagePath:'/pages/cart/index'
			},
			{
				iconPath: "https://labulado.oss-cn-guangzhou.aliyuncs.com/t7.png",
				selectedIconPath: "https://labulado.oss-cn-guangzhou.aliyuncs.com/t8.png",
				text: '我的',
				pagePath: '/pages/user/index',
			},
		],
	},
    mutations: {
		config (state, payload) {
			state.config = payload
		},
		orderTab (state, tab) {
			state.orderTab = tab
		},
		redirect (state, payload) {
			state.redirectPage = payload.page
		},
		searchStyle (state, style) {
			state.searchStyle = style
		},
		searchFixed (state, payload) {
			state.searchFixed = payload
		},
		userShip (state, userShip) {
			state.userShip = userShip
		},
		invoice (state, invoice) {
			state.invoice = invoice
		},
		changeAddress (state, value) {
			state.shopAddress = value
		}
	},
	actions: {

	},
	getters: {
		shopConfig: state => state.config,
		uuid: state	=>	state.uuid,
	}
})

export default store
